package com.qriver.ratelimiter.demo;

import com.qriver.ratelimiter.annotation.AccessLimiter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisController {

    @GetMapping("redis")
    @AccessLimiter(limit = 2, methodKey = "redis", timeout = 30)
    public String redis() throws InterruptedException {
        Thread.sleep(1000 * 2);
        return "success!";
    }

}
